Skip to content

refactor: simplify synchronization state and test tooling - #430

Merged
tisonkun merged 8 commits into
apache:mainfrom
tisonkun:codex/simplify-state-and-tooling
Nov 18, 2026
Merged

tisonkun merged 8 commits into
apache:mainfrom
tisonkun:codex/simplify-state-and-tooling

Conversation

@tisonkun

@tisonkun tisonkun commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Clear the value cell's publication flag before dropping an overwritten value so a panicking destructor leaves the slot empty. Use Pin::set for the state transitions that install and drop a lazy initializer.
  • Share watch publication across both send paths, encode event waiters as waiting or notified, and name the phase in which a phaser participant has already arrived.
  • Preserve measurement order in the upgradable-lock benchmark report and list the integration targets for cargo x miri in execution order.

OnceCell and LazyCell check the slot under exclusive access before initializing it. Reject an occupied slot before touching its value to avoid leaving a partially dropped value marked as published if its destructor panics.
Pin::set drops the old state in place before installing its replacement. Keep the poison guard around the completed future's destructor.
Advance the version, exchange the value and detach the waiters under one lock. Callers retain ownership of the exchanged value across the lock boundary, including if the counter overflows.
Both reset modes transfer the waker when detaching a waiting node. Represent that transition once so a notified manual-reset waiter stays ready across reset and cannot retain a waker.
The stored phase identifies an arrival that still needs to be observed. The same value prevents a repeated arrival or withdrawal from decrementing the count twice.
Compute the minimum, median and maximum with the harness summary function. Print the original measurements so slow early runs and timing drift remain visible.
Keep the selected binaries in execution order and use the same command builder for each. The library suite runs first with all features.
An old value can panic during destruction. Mark the slot empty before calling its destructor and publish the replacement only after writing it. This preserves exclusive overwrite semantics and prevents the cell from dropping the old value again during unwinding.
@tisonkun
tisonkun merged commit 3aaac5c into apache:main Nov 18, 2026
9 checks passed
@tisonkun
tisonkun deleted the codex/simplify-state-and-tooling branch November 18, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant